package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.DirectlyStoreDTO;
import com.lyf.scm.admin.api.dto.DirectlyStoreReturnDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description:
 *          直营预测计划--门店Remote
 * @author: haodong
 * @data: 2020/8/29 19:23
 */
@FeignClient(name = "scm-plan-service")
public interface DirectlyStoreRemote {
    /**
     * 按条件查询直营预测计划(周)
     *
     * @param salesPlanDirectly
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyStore/list")
    Response<PageInfo<DirectlyStoreReturnDTO>> listPageBySelective(@RequestBody DirectlyStoreDTO salesPlanDirectly);

    /**
     * 查询全部直营预测计划(周)
     *
     * @param salesPlanDirectly
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyStore/listAll")
    Response<List<DirectlyStoreReturnDTO>> listAllByCycles(@RequestBody DirectlyStoreDTO salesPlanDirectly);



    /**
     * 导出Excel
     *
     * @param directly
     * @param type
     * @return
     */
    @PostMapping(value = "/api/v1/salesPlanDirectlyStore/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Response<List<DirectlyStoreReturnDTO>> exportExcel(@RequestBody DirectlyStoreDTO directly, @RequestParam("type") Integer type);

    /**
     * 更新确认量
     * @param directlyUpdateList
     * @param unitType
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyStore/updateConfirm")
    Response<Boolean> updateConfirm(@RequestBody List<DirectlyStoreDTO> directlyUpdateList,
                                    @RequestParam("unitType") Long unitType);

    /**
     * 删除直营预测计划--门店
     *
     * @param opSign
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyStore/delete")
    Response delete(@RequestParam("opSign") String opSign);

    /**
     * 条件查询
     * @param directlyStore
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyStore/listByCondition")
    Response<List<DirectlyStoreDTO>> listByCondition(@RequestBody DirectlyStoreDTO directlyStore);
}
